package com.zx.erp.repo.mapper;

import com.zx.erp.repo.bean.KcWarehouse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 库存Dao接口
 *
 * @author Jerry
 */
@Mapper
@Repository
public interface KcWarehouseDao {

    /**
     * w.`C_NAME`,br.`BRAND_NAME`,ty.`TYPE_NAME`,pr.`PRODUCT_MODEL`
     *
     *
     * @return
     */
    List<KcWarehouse> findAllKc(@Param("cname") String cname, @Param("brandNmae") String brandNmae,
                                @Param("typeName") String typeName, @Param("proName") String proName);

    /**
     * dxj
     * 多条件查询所有
     *
     * @param cName        仓库名称
     * @param brandName    商品品牌
     * @param typeName     商品类型
     * @param productModel 商品名称
     * @return 筛选后集合
     */
    List<KcWarehouse> findAllByLike(String cName, String brandName, String typeName, String productModel);

    boolean addKC(KcWarehouse kcw);

    boolean updateKCw(KcWarehouse kcw);

    // 删除库存
    Boolean deleteKc(KcWarehouse kcWarehouse);

    List<KcWarehouse> selectBy5c(KcWarehouse kcw);

    KcWarehouse selectBy(KcWarehouse kcw);


    boolean updateKCW2(@Param("id")Integer id,@Param("repertory")Integer repertory,@Param("flag")Integer flag);

}